package com.lagou.edu;

import com.lagou.edu.dao.AccountDao;
import com.lagou.edu.dao.impl.JdbcAccountDaoImpl;
import com.lagou.edu.factory.AnnotationConfigApplicationContext;
import com.lagou.edu.factory.ApplicationContext;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @program: lagou-transfer
 * @author: GYL
 * @create: 2020-09-10 01:48
 * @description:
 */
public class Test {

    @org.junit.Test
    public void iocTest(){
        boolean assignableFrom = AccountDao.class.isAssignableFrom(JdbcAccountDaoImpl.class);
        System.out.println(assignableFrom);
        ApplicationContext applicationContext=new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountDao accountDao = (AccountDao) applicationContext.getBean("accountDao");
        System.out.println(accountDao);
    }

}